A virtual machine (VM) refers to a complete computer system that is simulated by using software, has a function of a complete hardware system, and is run in a completely isolated environment. Generally, one or more virtual machines can be simulated on one physical computer, and these virtual machines can work like real computers.
With increasing demands for improving server utilization and reducing a server cost, a server virtualization technology emerges based on a virtual machine technology. Server virtualization refers to abstracting a physical resource of a server into a logical resource, changing one server into several or even hundreds of virtual servers that are isolated from each other, or changing several servers into one server for use, so that restrictions of physical boundaries are overcome, and hardware such as a central processing unit (CPU), memory, a magnetic disk, or an input/output (I/O) changes into a “resource pool” that can be dynamically managed, thereby greatly improving resource utilization and simplifying system management. In a data center (DC) network, after a server is virtualized, traffic of multiple or even dozens of VMs may exist on a same physical port of a switch. For different VMs, corresponding information, for example, a network policy and a forwarding table, needs to be configured. Currently, the configuration of all of the corresponding information is implemented by means of manual configuration. When a state of a virtual machine changes, for example, when a server performs an operation, such as creation or deletion, on the virtual machine, the related configuration information also changes. However, a manual configuration method causes both a heavy workload and poor timeliness, which severely affect network performance.